package com.dlc.shop.bean.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 出入库明细
 *
 * @author LGH
 * @date 2021-09-09 13:11:15
 */
@Data
@TableName("tz_stock_bill_log")
public class StockBillLog implements Serializable{
    private static final long serialVersionUID = 1L;

    @TableId
    private Long stockBillLogId;

    @Schema(description = "出入库单id列表" )
    @TableField(exist = false)
    private List<Long> stockBillLogIds;

    @Schema(description = "出入库项id列表" )
    @TableField(exist = false)
    private List<Long> stockBillLogItemIds;

    @Schema(description = "出入库单号" )
    private String stockBillNo;

    @Schema(description = "关联订单号" )
    private String sourceOrderNo;

    @Schema(description = "单据类型" )
    private Integer stockBillType;

    @Schema(description = "创建时间" )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "创建开始时间" )
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createStartTime;

    @Schema(description = "创建结束时间" )
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createEndTime;

    @Schema(description = "更新时间" )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "出入库原因id" )
    private Long stockChangeReasonId;

    @Schema(description = "操作员工id" )
    private Long employeeId;

    @Schema(description = "状态，0：已作废，1：已出/入库，2：待提交" )
    private Integer status;

    @Schema(description = "出入库时间" )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date businessTime;

    @Schema(description = "出入库开始时间" )
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date businessStartTime;

    @Schema(description = "出入库结束时间" )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date businessEndTime;

    @Schema(description = "商品名称" )
    @TableField(exist = false)
    private String prodName;

    @Schema(description = "商品id")
    @TableField(exist = false)
    private Long prodId;

    @Schema(description = "1：商品名称 2：商品编码")
    @TableField(exist = false)
    private Integer prodKeyType;

    @Schema(description = "搜索商品关键词(0:商品名称 1：商品编码)" )
    @TableField(exist = false)
    private String prodKey;

    @Schema(description = "商品编码" )
    @TableField(exist = false)
    private String partyCode;

    @Schema(description = "总出入库数量" )
    private Integer totalCount;

    @Schema(description = "总出入库金额" )
    private Double totalAmount;

    @Schema(description = "出入库凭证" )
    private String qualifications;

    @Schema(description = "店铺id" )
    private Long shopId;

    @Schema(description = "供应商id" )
    private Long supplierId;


    @Schema(description = "备注" )
    private String remark;

    @Schema(description = "类型，1：出库 2：入库" )
    @Max(value = 2, message = "只能为1或2")
    @Min(value = 1, message = "只能为1或2")
    @NotNull(message = "类型不能为空")
    private Integer type;

    @TableField(exist = false)
    @Schema(description = "出入库商品项列表" )
    private List<StockBillLogItem> stockBillLogItems;

    @Schema(description = "制单人手机号" )
    @TableField(exist = false)
    private String employeeMobile;

    @Schema(description = "其他出/入库原因" )
    @TableField(exist = false)
    private String reason;

    @Schema(description = "供应商名称" )
    @TableField(exist = false)
    private String supplierName;

    @Schema(description = "制单人手机号" )
    private String makerMobile;

    @Schema(description = "制单人昵称" )
    @TableField(exist = false)
    private String makerName;

    @Schema(description = "库存点id")
    private Long stockPointId;

    @Schema(description = "库存点类型(1:仓库, 2:门店)")
    private Integer stockPointType;

    @Schema(description = "库存点名称" )
    @TableField(exist = false)
    private String stockPointName;
}
